package com.alibaba.csp.sentinel.dashboard.rule.nacos.authority;

import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity;
import com.alibaba.csp.sentinel.dashboard.rule.nacos.AbstractDynamicProvider;
import com.alibaba.csp.sentinel.dashboard.rule.nacos.NacosConfigUtil;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * 授权规则
 * @author chengjian 
 * @date 2021/7/7
 */
@Component("authorityRuleNacosProvider")
public class AuthorityRuleNacosProvider extends AbstractDynamicProvider<AuthorityRuleEntity> {

    @Override
    public List<AuthorityRuleEntity> getRules(String appName) {
        return getRulesByDataId(appName,AuthorityRuleEntity.class);
    }

    @Override
    public String ruleName() {
        return NacosConfigUtil.AUTHORITY_DATA_ID_POSTFIX;
    }
}
